import { createApp } from "vue";
import "./styles/main.scss";
import App from "./App.vue";
import { RegisterRouter } from "@/router";
import { RegisterStore } from "./stores";
import { RegisterGlobalComponent } from "./components";
import { RegisterVuei18n } from "@/plugin/vue-i18n";
import { initAppConfigStore } from "@/logics/initAppConfig";
// import { RegisterErrorHandle } from "@/logics/error-handle";

// 启动配置
const bootstrap = () => {
  const app = createApp(App);

  // 注册--状态管理
  RegisterStore(app);
  // 注册--路由
  RegisterRouter(app);
  // 注册--项目初始配置
  initAppConfigStore();
  // 注册--路由守卫
  // RegisterRouterGuard(router);
  // 注册--全局组件
  RegisterGlobalComponent(app);
  // 注册Vi18n
  RegisterVuei18n(app);
  // 注册全局错误处理
  // RegisterErrorHandle(app);

  app.mount("#app");
};

bootstrap();
